import sys, re
from util import *

if len(sys.argv) != 2:
    print "Usage: simple_markup.py filename"
    sys.exit()

fo = open(sys.argv[1])

print '<html><head><title>...</title><body>'

title = True
for block in blocks(fo):
    block = re.sub(r'\*(.+?)\*', r'<em>\1</em>', block)
    if title:
        print '<h1>'
        print block
        print '</h1>'
        title = False
    else:
        print '<p>'
        print block
        print '</p>'

print '</body></html>'

fo.close()
